<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
		
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		
		<title><?php echo C("SITE_INFO.name");?></title>
	
		
		
		<!--                       CSS                       -->
	  
		<!-- Reset Stylesheet -->
		<link rel="stylesheet" href="__PUBLIC__/css/reset.css" type="text/css" media="screen" />
	  
		<!-- Main Stylesheet -->
		<link rel="stylesheet" href="__PUBLIC__/css/cms_admin/style.css" type="text/css" media="screen" />
		
		<!-- Invalid Stylesheet. This makes stuff look pretty. Remove it if you want the CSS completely valid -->
		<link rel="stylesheet" href="__PUBLIC__/css/invalid.css" type="text/css" media="screen" />	
		

	  
		<!-- jQuery -->
		<script type="text/javascript" src="__PUBLIC__/scripts/jquery-1.7.2.min.js"></script>
		
		<!-- jQuery Configuration -->
		<script type="text/javascript" src="__PUBLIC__/scripts/simpla.jquery.configuration.js"></script>
        		
		<!-- jQuery WYSIWYG Plugin -->
		<script type="text/javascript" src="__PUBLIC__/scripts/jquery.wysiwyg.js"></script>
  
		 <!-- jQuery UI  -->         
		<link rel="stylesheet" href="__PUBLIC__/scripts/ui/redmond/jquery-ui-1.8.6.css">        
        <script type="text/javascript" src="__PUBLIC__/scripts/ui/jquery-ui-1.8.6.min.js"></script>
		
        <script src="__PUBLIC__/scripts/utils.js" type="text/javascript"></script>
        
    <!-- ckeditor  -->        
     <link rel="stylesheet" href="__PUBLIC__/kindeditor/themes/default/default.css" />
     <script charset="utf-8" src="__PUBLIC__/kindeditor/kindeditor.js"></script>
        
	  <script>	
          KindEditor.ready(function(K) {
              var editor = K.create('textarea.HTMLeditor', {
                          allowFileManager : true,
                          width : 800,
                          height : 400,
						  afterBlur: function(){this.sync();}
				}); 
          });	
      </script>
       
      <script type="text/javascript" src="__PUBLIC__/scripts/fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
      <script type="text/javascript" src="__PUBLIC__/scripts/fancybox/jquery.fancybox-1.3.4.pack.js"></script>      
      <link rel="stylesheet" type="text/css" href="__PUBLIC__/scripts/fancybox/jquery.fancybox-1.3.4.css" media="screen" />
      <script>
	  $(function(){
		 $("a.fancyBox").fancybox(); 
	  })	 
	  </script>
      
        
        
     <script>
        $(function() {
		  
		  $(".status .light").click(function(){		
			   var id = $(this).parent().parent().attr("id");
			   $.get("<?php echo U('changeStatus');?>", { id: id },
				function(data){
					 $("#"+id).find("span").removeClass("current");
				 	 if (data == 1)
					 {
						 $("#"+id).find("span").eq(0).addClass("current");
					 }
					 else
					 {
						 $("#"+id).find("span").eq(1).addClass("current");
					 }
				}); 
		  })  		
	})
      
		
	</script>
	</head>
  
	<body >
    
    <div id="body-wrapper" > <!-- Wrapper for the radial gradient background -->		

        <!--left start-->
		
        <div id="sidebar"   >
 <div id="sidebar-wrapper" style="position:relative; height:100%"> 
 <!-- Sidebar with logo and menu -->
		  
    <!-- Sidebar Profile links -->
    <div id="profile-links" style="margin-top:110px; font-size:12px;">
        Hello, <a href="#" onclick="return false;" title="Edit your profile"><?php echo ($loginName); ?></a>			
        <br />
        <br />
        <a href="__APP__" target="_blank" title="View the Site">View the Site</a> | 
        <a href="<?php echo U('Login/logoff');?>" title="Sign Out">Sign Out</a>
     </div>     
        
			
<ul id="main-nav"> 		
				
<?php echo W('Nav');?>
<!--	<li id="li_Menu_1">    
	    <a href="#" class="nav-top-item  <?php if((MODULE_NAME != "Users") and (MODULE_NAME != "Configuration")): ?>current<?php endif; ?>">Menu</a>
    	<ul style='display:none;' >
        	
            <?php if(is_array($nav_name)): $i = 0; $__LIST__ = $nav_name;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i; if(($v != 'Users') and ($v != 'Configuration')): ?><li>           
                        <a href="<?php echo U($v.'/index');?>" class="<?php if(MODULE_NAME == $v): ?>current<?php endif; ?>"><?php echo ($v); ?></a>
                    </li><?php endif; endforeach; endif; else: echo "" ;endif; ?>	        
		</ul>
	</li>	
  <?php if((in_array('Users',$nav_name)) or in_array('Configuration',$nav_name) or (session('adminId') == 1) ): ?><li id="li_Menu_2">    
            <a href="#" class="nav-top-item <?php if((MODULE_NAME == "Users") or (MODULE_NAME == "Configuration")): ?>current<?php endif; ?>">Configuration</a>
            <ul style='display:none;' >
                
               <?php if(is_array($nav_name)): $i = 0; $__LIST__ = $nav_name;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i; if(($v == 'Users') OR ($v == 'Configuration')): ?><li>           
                            <a href="<?php echo U($v.'/index');?>" class="<?php if(MODULE_NAME == $v): ?>current<?php endif; ?>"><?php echo ($v); ?></a>
                        </li><?php endif; endforeach; endif; else: echo "" ;endif; ?>	        
            </ul>
        </li><?php endif; ?> -->
    
    
    	
</ul> 				
  </div>
</div> 
        <!--left end-->
        
        
        <!-- End #sidebar -->			
		<div id="main-content"> <!-- Main Content Section with everything -->
        <div  id="header_logo"><?php echo C("SITE_INFO.name");?></div>	 		
			
			<!-- Page Head -->
			<div style="float:left; width:380px;">
			  <h2>订单列表  </h2></div>
			  <div id="sreach">
            <form name="sreach" method="get" action="<?php echo U('index');?>">
               <a class="button" href="<?php echo U('Sorder/ToExcel');?>?provcode=<?php echo ($provcode); ?>&citycode=<?php echo ($citycode); ?>&area_id=<?php echo ($area_id); ?>&fee_id=<?php echo ($fee_id); ?>&status=<?php echo ($status); ?>&deal_status=<?php echo ($deal_status); ?>&keyword=<?php echo ($keyword); ?>" >导出数据</a>
              <?php echo W('Shengshi',array('now_city_id'=>$citycode,'now_prov_id'=>$provcode,'now_area_id'=>$area_id));?>
             <!--   <strong>分类:</strong>
             <select onChange="document.getElementById('keyword').value='';document.sreach.submit(); return false;" name="category">
                <?php if(is_array($cate)): foreach($cate as $key=>$vo): ?><option value="<?php if($vo['id'] == 0): else: echo ($vo["id"]); endif; ?>"   <?php if($vo['id'] == $category ): ?>selected="selected"<?php endif; ?>><?php echo ($vo["text"]); ?></option><?php endforeach; endif; ?>
              </select> -->
               &nbsp;<strong>订单支付状态:</strong>
              <select onChange="document.getElementById('keyword').value='';document.sreach.submit(); return false;" name="fee_order_status">
                <option value="-1" <?php if($fee_order_status == -1): ?>selected="selected"<?php endif; ?> >All Status</option>
                 <option value="1" <?php if($fee_order_status == 1 ): ?>selected="selected"<?php endif; ?> >已支付</option>  
                <option value="0"<?php if($fee_order_status == 0 ): ?>selected="selected"<?php endif; ?> >未支付</option>
                            
              </select><br/><br/>
               &nbsp;<strong>订单处理状态:</strong>
              <select onChange="document.getElementById('keyword').value='';document.sreach.submit(); return false;" name="deal_status">
                <option value="-1" <?php if($deal_status == -1): ?>selected="selected"<?php endif; ?> >All Status</option>
                 <option value="1" <?php if($deal_status == 1 ): ?>selected="selected"<?php endif; ?> >已确认</option>  
                <option value="0"<?php if($deal_status == 0 ): ?>selected="selected"<?php endif; ?> >未确认</option>
                            
              </select>
              &nbsp;<strong>套餐:</strong>
              <select onChange="document.getElementById('keyword').value='';document.sreach.submit(); return false;" name="fee_id">
                <option value="-1" <?php if($fee_id == -1): ?>selected="selected"<?php endif; ?> >全部套餐</option>
                 <option value="1" <?php if($fee_id == 1 ): ?>selected="selected"<?php endif; ?> >置顶</option>  
                <option value="2"<?php if($fee_id == 2 ): ?>selected="selected"<?php endif; ?> >加急</option>
                <option value="3"<?php if($fee_id == 3 ): ?>selected="selected"<?php endif; ?> >置顶与加急</option>
                            
              </select>
              <input type="text" value="<?php echo ($keyword); ?>" style="width:150px;" class="text-input " id="keyword" name="keyword" placeholder="产品、电话、订单号">
              <strong><a onClick="document.sreach.submit(); return false;" href="#">Search</a></strong>
            </form>
            </div>
            
			<div class="clear"></div> <!-- End .clear -->
            <?php echo ($msg); ?>
               <div class="content-box"><!-- Start Content Box -->                  
                  <div class="content-box-header">  
                      <span class="insert" style=" float:right; line-height:40px; font-size:14px; font-weight:bold;"> 
                      
                      <a href="<?php echo U('detail');?>" style="display:none;">+ insert </a>&nbsp; &nbsp; </span>
                    <div class="clear"></div>                      
                  </div> <!-- End .content-box-header -->
                  
                  <div class="content-box-content">
                      <div class="tab-content default-tab" id="tab1">                       
                      <!-- This is the target div. id must match the href of this div's tab -->	
                      
                          
                          <table id="list">
                            <thead>
                              <tr >		   
                                  <th>订单编号<?php echo createUpDownLink('fee_order_num');?></th>
                                  <th>时间<?php echo createUpDownLink('add_date');?></th> 
                                  <th>商品名称<?php echo createUpDownLink('products_name');?></th>   
                                  <!-- <th  >Category</th>  -->                             
                                  <th  >用户</th>
                                  <th  >电话</th>
                                  <th  >套餐</th>
                                  <th  >支付金额</th>
                                  <th  >支付状态</th>
                                  <th  >操作状态</th> 
                                  <th>订单过期</th>                                  	                                                                                                        
                                  <th  width="200" style="text-align:center">操作</th>									   						 
                              </tr>								
                            </thead> 
                            
                   
                
                            <tbody>                              
                            <?php if(is_array($infoList)): $i = 0; $__LIST__ = $infoList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr align="center" <?php if(($mod) == "1"): ?>class="alt-row"<?php endif; ?>>
                                	<td align="left" class="first-cell" >
                                      <?php echo ($vo["fee_order_num"]); ?>
                                      </td>
                                      <td>
                                      	<?php echo ($vo["add_date"]); ?>
                                      </td>
                                      <td align="left">
                                      <?php echo ($vo["products_name"]); ?>
                                      </td>
                                      <td align="left">
                                      <?php echo ($vo["member_name"]); ?>
                                      </td>
                                      <td align="left">
                                      <?php echo ($vo["tel"]); ?>
                                      </td>
                                      <td align="left">
                                      <?php echo ($vo["fee_name"]); ?>
                                      </td>
                                      <td align="left">
                                      <?php echo ($vo["fee_money"]); ?>
                                      </td>
                                      
                                      <td align="left">
                                      <?php if($vo['fee_order_status'] == 1): ?>已支付<?php else: ?>未支付<?php endif; ?>
                                      </td>
                                      <td align="left">
                                      <?php if($vo['deal_status'] == 1): ?>已确认<?php else: ?>未确认<?php endif; ?>
                                      </td>
                                      <td align="left">
                                      <?php if($vo['fee_status'] == 1): ?>已过期<?php else: ?>未过期<?php endif; ?>
                                      </td>
                                      <td align="center" >   
                                        <?php if($vo['deal_status'] == 0): ?><a href="<?php echo U('Sorder/confirm');?>?editId=<?php echo ($vo["fee_order_id"]); ?>"  <?php if($vo['fee_order_status'] == 0): ?>onClick="return confirm('还没有付款，去人要处理吗?')"<?php endif; ?> title="confirm">确认已支付</a><?php endif; ?> &nbsp; &nbsp;                              
                                      <!--  <a href="<?php echo U('Order/lose');?>?editId=<?php echo ($vo["order_id"]); ?>"  onClick="return confirm('确认让订单失效吗?')"  title="cancel">订单失效</a> --> 
                                       <a href="<?php echo U('Sorder/cancel');?>?editId=<?php echo ($vo["fee_order_id"]); ?>"  onClick="return confirm('确认删除订单吗?')"  title="cancel">删除</a> 
                                      </td>
                                    </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                            </tbody>
                          </table>
                          <div class="pagination"><?php echo ($page); ?><div style=" clear:both;"></div></div>						
                      </div> <!-- End #tab1 -->	
                                       
                      
                  </div> <!-- End .content-box-content -->
                  
              </div> <!-- End .content-box -->
             
			
			
			<div class="clear"></div>
			
			
			<!-- Start Notifications -->
			
			

			
			<!-- End Notifications -->
			
            <div id="footer">
				<small> <!-- Remove this notice or replace it with whatever you want -->
						&#169; Copyright 2013
				</small>
			</div>
			
			
			
			<!-- End #footer -->
			
		</div> <!-- End #main-content -->
		
	</div>
	</body>
<!-- Download From www.exet.tk-->
</html>